package com.demo.Service.Impl;

import com.demo.Service.NewsService;
import com.demo.common.MessageUtils;
import com.demo.entity.News;
import com.demo.mapper.NewsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NewsServiceImpl implements NewsService {
    @Autowired
    NewsMapper newsMapper;

    @Override
    public MessageUtils<?> addNews(News news) {
        Integer i = newsMapper.addNews(news);
        return new MessageUtils<>(i>0?200:500,i>0?"成功":"失败");
    }
}
